package com.zhentao.enums.admin;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 用户表
 * @TableName ad_user
 */
@TableName(value ="ad_user")
@Data
public class AdUser implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 账号
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 姓名
     */
    @TableField(value = "administrator_name")
    private String administratorName;

    /**
     * 性别
     */
    @TableField(value = "gender")
    private String gender;

    /**
     * 年龄
     */
    @TableField(value = "age")
    private Integer age;

    /**
     * 盐
     */
    @TableField(value = "salt")
    private String salt;

    /**
     * 头像
     */
    @TableField(value = "administrator_image")
    private String administratorImage;


    /**
     * 电话
     */
    @TableField(value = "administrator_phone")
    private String administratorPhone;

    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 是否删除（1未删除/2删除）
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    @TableField(value = "create_by")
    private Integer createBy;

    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @TableField(value = "update_by")
    private Integer updateBy;

    @TableField(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 用户对应的角色
     */
    @TableField(exist = false)
    private List<AdRole> rolesList;

    @TableField(exist = false)
    private List<AdMenu> adMenuList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
